home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE background PUBLIC "-//Apple, Inc.//DTD background V 2.0//EN" "" >
- <background>
- <id>4920</id>
- <filler1>0</filler1>
- <bitmap>BMAP_6737.pbm</bitmap>
- <cantDelete> <false /> </cantDelete>
- <showPict> <true /> </showPict>
- <dontSearch> <false /> </dontSearch>
- <link rel="stylesheet" type="text/css" href="stylesheet_3099.css" />
- <part>
- <id>1</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <false /> </lockText>
- <rect>
- <left>3</left>
- <top>53</top>
- <right>510</right>
- <bottom>253</bottom>
- </rect>
- <style>scrolling</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Geneva</font>
- <textSize>9</textSize>
- <textStyle>plain</textStyle>
- <textHeight>12</textHeight>
- <name>TXT</name>
- <script></script>
- </part>
- <part>
- <id>2</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <true /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>105</left>
- <top>3</top>
- <right>312</right>
- <bottom>21</bottom>
- </rect>
- <style>rectangle</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name>DownloadFolder</name>
- <script>on mouseDown
- answer folder "Select the folder to download HTML file from remote host"
- put it into tmp
- if tmp is empty then exit mouseDown
- put tmp into fld "DownloadFolder"
- end mouseDown
- </script>
- </part>
- <part>
- <id>3</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <false /> </lockText>
- <rect>
- <left>336</left>
- <top>2</top>
- <right>510</right>
- <bottom>20</bottom>
- </rect>
- <style>rectangle</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name>UserID</name>
- <script></script>
- </part>
- <part>
- <id>4</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <false /> </lockText>
- <rect>
- <left>3</left>
- <top>32</top>
- <right>510</right>
- <bottom>51</bottom>
- </rect>
- <style>rectangle</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name>HTTP</name>
- <script></script>
- </part>
- <part>
- <id>5</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <true /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <false /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <true /> </lockText>
- <rect>
- <left>2</left>
- <top>255</top>
- <right>380</right>
- <bottom>313</bottom>
- </rect>
- <style>scrolling</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Geneva</font>
- <textSize>9</textSize>
- <textStyle>plain</textStyle>
- <textHeight>12</textHeight>
- <name>URLs</name>
- <script>on mouseDoubleClick
- set cursor to watch
- select the clickLine
- put the value of the clickLine into tmpHTTP
- put fld "DownloadFolder" into tmpPath
- if there is a cd tmpHTTP then
- go to cd tmpHTTP
- else
- set lockscreen to true
- go to first cd of this bkgnd
- domenu "New card"
- set lockscreen to false
- put tmpHTTP into fld "HTTP" of this cd
- set name of this cd to tmpHTTP
- send mouseUp to bkgnd button "GetURL"
- end if
- end mouseDoubleClick</script>
- </part>
- <part>
- <id>7</id>
- <type>button</type>
- <visible> <true /> </visible>
- <reserved5> 0 </reserved5>
- <reserved4> 0 </reserved4>
- <reserved3> 0 </reserved3>
- <reserved2> 0 </reserved2>
- <reserved1> 0 </reserved1>
- <enabled> <true /> </enabled>
- <rect>
- <left>315</left>
- <top>2</top>
- <right>333</right>
- <bottom>20</bottom>
- </rect>
- <style>checkbox</style>
- <showName> <false /> </showName>
- <highlight> <false /> </highlight>
- <autoHighlight> <true /> </autoHighlight>
- <sharedHighlight> <true /> </sharedHighlight>
- <family>0</family>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <name>UserId</name>
- <script></script>
- </part>
- <part>
- <id>10</id>
- <type>button</type>
- <visible> <true /> </visible>
- <reserved5> 0 </reserved5>
- <reserved4> 0 </reserved4>
- <reserved3> 0 </reserved3>
- <reserved2> 0 </reserved2>
- <reserved1> 0 </reserved1>
- <enabled> <true /> </enabled>
- <rect>
- <left>219</left>
- <top>315</top>
- <right>308</right>
- <bottom>340</bottom>
- </rect>
- <style>standard</style>
- <showName> <true /> </showName>
- <highlight> <false /> </highlight>
- <autoHighlight> <true /> </autoHighlight>
- <sharedHighlight> <true /> </sharedHighlight>
- <family>0</family>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <name>getURL</name>
- <script>on mouseUp
-
- set cursor to watch
-
- ---------------------------------------------
- -- URLName must be in a form of
- -- http://aaa.bbb.com or
- -- http://aaa.bbb.com/filename
- ---------------------------------------------
- put fld "HTTP" into URLName
-
- ---------------------------------------------
- -- fileName must be in a form of
- -- HardDrive:folder:...folder:file
- -- http://aaa.bbb.com/filename
- ---------------------------------------------
- put fld "DownloadFolder" into dest
- put dest & "tmpHTML.html" into fileName
-
- ---------------------------------------------
- -- Basic security (authentication) is possible
- -- if site want USERID and PASSWORD, put them
- -- into the field in a form userID:password
- -- and check the button. Don't forget uncheck the
- -- button after you visited secured site! Your
- -- password will be send until you uncheck the
- -- button.
- ---------------------------------------------
-
- if hilite of bkgnd button "UserID" is true then
- put fld "UserID" into userId
- getURL URLName, fileName, userId
- else
- getURL URLName, fileName
- end if
-
- ---------------------------------------------
- -- getURL depends on the Internet traffic,
- -- remote host, DNS server, etc. So, be prepare
- -- to wait. The worst case may cause 1-2 minutes
- -- hard wait state. If network is OK, getURL
- -- working in assync mode, and you may switch to
- -- another application while receiving.
- -- If you lucky, getURL would save received text
- -- in the file, if not you will get ERROR message.
- -- Mostly the reasons for ERRORs are:
- -- - remote host not responding;
- -- - name is unknown (your mistake or DNS server mistake);
- -- - trafic is very slow for some reason;
- -- - etc.
- ---------------------------------------------
- if the first word of the result is not "OK" then
- put the result into fld "TXT"
- play boing
- exit mouseUp
- end if
-
- ---------------------------------------------
- -- Now we can do a lot of things with this file.
- -- Let's go!
- ---------------------------------------------
- open file fileName
- read from file fileName until end
- put it into tmpHTML
- close file fileName
-
- ---------------------------------------------
- -- Why we need HTTP header? Delete it! But!
- -- In many cases, it contain a usefull information,
- -- for example: File not found, Access denied, etc.
- ---------------------------------------------
- put tmpHTML into tmp
- repeat for number of lines of tmpHTML
- if first line of tmpHTML is linefeed OR ¬¬
- first line of tmpHTML is return then exit repeat
- end repeat
-
- if tmpHTML is empty then
- put tmp into tmpHTML
- end if
- ---------------------------------------------
- -- Let's parse text and get all references to another
- -- pages with HTMLtoURL external.
- ---------------------------------------------
- put HTMLtoURL (tmpHTML) into URLs
-
- ---------------------------------------------
- -- URLs may contain duplicats, internal references, and be
- -- unsorted. Let's clean this garbage.
- ---------------------------------------------
- put adjustURL (URLs, fld "HTTP") into fld "URLs"
-
- ---------------------------------------------
- -- Now time to convert HTML to plain text.
- -- You can keep all texts in
- -- your knowledge base, generate new cards, etc.
- -- Next version of HTMLtoTXT will be more advanced.
- ---------------------------------------------
- put HTMLtoTXT (tmpHTML) into tmpTXT
-
- ---------------------------------------------
- -- Result is ugly a little bit. Many returns,
- -- TABs, double spaces, etc.
- -- cleanUpTxt will do thi job.
- ---------------------------------------------
- put cleanUpTxt (tmpTXT) into tmpTXT
-
- ---------------------------------------------
- -- Hopefully, HyperCard 3.0 will fix the field limitation
- -- As for now, 30000 is a limit for field.
- -- Some of pages bigger then HC limitation
- -- Even if page bigger then field, the part may be
- -- usefull.
- ---------------------------------------------
- if length of tmpTXT < 30000 then
- put tmpTXT into fld "TXT"
- else
- put char 1 to 29000 of tmpTXT into fld "TXT"
- end if
-
- ---------------------------------------------
- -- Horay! The end.
- ---------------------------------------------
- beep 1
- set cursor to normal
- end mouseUp
- </script>
- </part>
- <part>
- <id>12</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <true /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <true /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <false /> </lockText>
- <rect>
- <left>408</left>
- <top>266</top>
- <right>509</right>
- <bottom>300</bottom>
- </rect>
- <style>rectangle</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <textHeight>16</textHeight>
- <name>URLs</name>
- <script>on mouseDoubleClick
- set cursor to watch
- select the clickLine
- put the value of the clickLine into cd fld "HTTP"
- send mouseUp to cd button "GetURL"
- end mouseDoubleClick</script>
- </part>
- <part>
- <id>13</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <true /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <true /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <false /> </lockText>
- <rect>
- <left>384</left>
- <top>273</top>
- <right>409</right>
- <bottom>292</bottom>
- </rect>
- <style>rectangle</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Charcoal</font>
- <textSize>12</textSize>
- <textStyle>bold</textStyle>
- <textHeight>16</textHeight>
- <name>URLs</name>
- <script>on mouseDoubleClick
- set cursor to watch
- select the clickLine
- put the value of the clickLine into cd fld "HTTP"
- send mouseUp to cd button "GetURL"
- end mouseDoubleClick</script>
- </part>
- <part>
- <id>16</id>
- <type>button</type>
- <visible> <true /> </visible>
- <reserved5> 0 </reserved5>
- <reserved4> 0 </reserved4>
- <reserved3> 0 </reserved3>
- <reserved2> 0 </reserved2>
- <reserved1> 0 </reserved1>
- <enabled> <true /> </enabled>
- <rect>
- <left>2</left>
- <top>315</top>
- <right>32</right>
- <bottom>340</bottom>
- </rect>
- <style>standard</style>
- <showName> <false /> </showName>
- <highlight> <false /> </highlight>
- <autoHighlight> <true /> </autoHighlight>
- <sharedHighlight> <true /> </sharedHighlight>
- <family>0</family>
- <titleWidth>0</titleWidth>
- <icon>1014</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <name>New Button</name>
- <script>on mouseUp
- go previous cd
- end mouseUp</script>
- </part>
- <part>
- <id>18</id>
- <type>button</type>
- <visible> <true /> </visible>
- <reserved5> 0 </reserved5>
- <reserved4> 0 </reserved4>
- <reserved3> 0 </reserved3>
- <reserved2> 0 </reserved2>
- <reserved1> 0 </reserved1>
- <enabled> <true /> </enabled>
- <rect>
- <left>34</left>
- <top>315</top>
- <right>64</right>
- <bottom>340</bottom>
- </rect>
- <style>standard</style>
- <showName> <false /> </showName>
- <highlight> <false /> </highlight>
- <autoHighlight> <true /> </autoHighlight>
- <sharedHighlight> <true /> </sharedHighlight>
- <family>0</family>
- <titleWidth>0</titleWidth>
- <icon>30557</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <name>New Button</name>
- <script>on mouseUp
- go second cd of this stack
- end mouseUp</script>
- </part>
- <part>
- <id>19</id>
- <type>button</type>
- <visible> <true /> </visible>
- <reserved5> 0 </reserved5>
- <reserved4> 0 </reserved4>
- <reserved3> 0 </reserved3>
- <reserved2> 0 </reserved2>
- <reserved1> 0 </reserved1>
- <enabled> <true /> </enabled>
- <rect>
- <left>480</left>
- <top>315</top>
- <right>510</right>
- <bottom>340</bottom>
- </rect>
- <style>standard</style>
- <showName> <false /> </showName>
- <highlight> <false /> </highlight>
- <autoHighlight> <true /> </autoHighlight>
- <sharedHighlight> <true /> </sharedHighlight>
- <family>0</family>
- <titleWidth>0</titleWidth>
- <icon>1013</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <name>New Button</name>
- <script>on mouseUp
- go next cd
- end mouseUp</script>
- </part>
- <part>
- <id>20</id>
- <type>button</type>
- <visible> <true /> </visible>
- <reserved5> 0 </reserved5>
- <reserved4> 0 </reserved4>
- <reserved3> 0 </reserved3>
- <reserved2> 0 </reserved2>
- <reserved1> 0 </reserved1>
- <enabled> <true /> </enabled>
- <rect>
- <left>448</left>
- <top>315</top>
- <right>478</right>
- <bottom>340</bottom>
- </rect>
- <style>standard</style>
- <showName> <false /> </showName>
- <highlight> <false /> </highlight>
- <autoHighlight> <true /> </autoHighlight>
- <sharedHighlight> <true /> </sharedHighlight>
- <family>0</family>
- <titleWidth>0</titleWidth>
- <icon>1012</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <name>New Button</name>
- <script>on mouseUp
- go back
- end mouseUp</script>
- </part>
- <part>
- <id>21</id>
- <type>button</type>
- <visible> <true /> </visible>
- <reserved5> 0 </reserved5>
- <reserved4> 0 </reserved4>
- <reserved3> 0 </reserved3>
- <reserved2> 0 </reserved2>
- <reserved1> 0 </reserved1>
- <enabled> <true /> </enabled>
- <rect>
- <left>101</left>
- <top>315</top>
- <right>187</right>
- <bottom>340</bottom>
- </rect>
- <style>standard</style>
- <showName> <true /> </showName>
- <highlight> <false /> </highlight>
- <autoHighlight> <true /> </autoHighlight>
- <sharedHighlight> <true /> </sharedHighlight>
- <family>0</family>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>center</textAlign>
- <font>Chicago</font>
- <textSize>12</textSize>
- <textStyle>plain</textStyle>
- <name>Fill from IC</name>
- <script>on mouseUp
- put GetICPref ("DownloadFolder") into bkgnd fld "DownloadFolder"
- end mouseUp
- </script>
- </part>
- <part>
- <id>22</id>
- <type>field</type>
- <visible> <true /> </visible>
- <dontWrap> <false /> </dontWrap>
- <dontSearch> <false /> </dontSearch>
- <sharedText> <true /> </sharedText>
- <fixedLineHeight> <false /> </fixedLineHeight>
- <autoTab> <false /> </autoTab>
- <lockText> <false /> </lockText>
- <rect>
- <left>1</left>
- <top>3</top>
- <right>103</right>
- <bottom>19</bottom>
- </rect>
- <style>shadow</style>
- <autoSelect> <false /> </autoSelect>
- <showLines> <false /> </showLines>
- <wideMargins> <false /> </wideMargins>
- <multipleLines> <false /> </multipleLines>
- <reservedFamily> 0 </reservedFamily>
- <titleWidth>0</titleWidth>
- <icon>0</icon>
- <textAlign>left</textAlign>
- <font>Geneva</font>
- <textSize>9</textSize>
- <textStyle>bold</textStyle>
- <textHeight>12</textHeight>
- <name></name>
- <script></script>
- </part>
- <content>
- <layer>background</layer>
- <id>12</id>
- <text>DoubleClick to
- open URL</text>
- </content>
- <content>
- <layer>background</layer>
- <id>13</id>
- <text><span class="style29">-</span></text>
- </content>
- <content>
- <layer>background</layer>
- <id>2</id>
- <text>SYSTEM:tmp:</text>
- </content>
- <content>
- <layer>background</layer>
- <id>22</id>
- <text>Download folder:</text>
- </content>
- <name></name>
- <script>on openCard
- if the name of this cd is not fld "HTTP" of this cd
- then set name of this cd to fld "HTTP" of this cd
- pass openCard
- end openCard
-
- on closeCard
- if the name of this cd is not fld "HTTP" of this cd
- then set name of this cd to fld "HTTP" of this cd
- pass closeCard
- end closeCard
- </script>
- </background>
-